{% extends 'easydisAPSBundle::base_template.html.twig' %}

{% block stylesheets %}
    <link rel="stylesheet" href="{{ asset('bundles/easydisAPS/css/css-table.css') }}" type="text/css" media="all" />
    <link rel="stylesheet" href="{{ asset('bundles/easydisAPS/css/form.css') }}" type="text/css" media="all" />
    <link rel="stylesheet" href="{{ asset('bundles/easydisAPS/smoothness/jquery-ui-1.10.3.custom.css') }}" />
{% endblock %}
    
{% block scripts %}
    <script type="text/javascript" src="{{ asset('bundles/easydisAPS/js/style-table.js') }}"></script>
    <script type="text/javascript" src="{{ asset('bundles/easydisAPS/js/jquery-1.10.2.min.js') }}"></script>
    <script src="{{ asset('bundles/easydisAPS/smoothness/jquery-ui-1.10.3.custom.js') }}"></script>
    <script type="text/javascript" src="{{ asset('bundles/easydisAPS/js/datepickerFR.js') }}"></script>
    
    <script>
        $(function(){
            $('#date').datepicker();
        });
    </script>
{% endblock %}

{% block position %}
    <a href="#" title="Vous êtes ici" class="tip-bottom"><i class="icon-th-list"></i> Tableau prévisionnel</a>
{% endblock %}


{% block contenu %}

<form id="madate" name="date" method="post" action="{{ path('easydisAPSBundle_redirect', {'date': dateC,'mode':'prevJ','gs': exploit}) }}">
        <legend style="width: 200px; font-size: 17px; margin-bottom: 10px;"> Modification de la date : </legend>
        <input type="input" name="date" id="date" size="10" readonly="readonly" style="width:100px;"/>
        <button type="submit" class="btn-info">Valider</button>
</form>
<br/><br/><br/>
<center>

<table id="travel">

	<caption>Prevision pour le : {{ dateC }}</caption>
    
    <thead>    
    	<tr>
            <th scope="col" rowspan="2"><h4>Eurocentre : Frais</h4></th>
            <th scope="col" colspan="3">Heures</th>
            <th scope="col" colspan="3">Unités d'oeuvre</th>
            <th scope="col" colspan="3">Productivité</th>
        </tr>
        
        <tr>
            <th scope="col">Prev</th>
            <th scope="col">Obj</th>
            <th scope="col">Ecart</th>
            <th scope="col">Prev</th>
            <th scope="col">Obj</th>
            <th scope="col">Ecart</th>
            <th scope="col">Prev</th>
            <th scope="col">Obj</th>
            <th scope="col">Perf</th>
        </tr>        
    </thead>
    
    <tfoot>
    	<tr>
        <th scope="row">Total Exploitation</th>
        {% for item in tabTotalExploit %}
            <td>{{ item }}</td>
        {% endfor %}
        </tr>
    </tfoot>
    
    
    
    <tbody>
    {% for tab in tabResult %}
        {% set i = 0 %}
        {% set type = 'service' %}
        {% for ligne in tab if i < 11 %}
          {% if i == 0 and ligne == 'groupe_service'%}
              <tr class="grey">
              {% set type = 'groupe_service' %}
          {% elseif i == 0 %}
              <tr>
          {% elseif i == 1 %}
              <th scope="row">
                {% if type == 'groupe_service' %} <a href="{{ path('easydisAPSBundle_redirect', {'date': dateC,'mode':'add_update','gs': tab[11].id}) }}"><img src="{{ asset('bundles/easydisAPS/images/application_edit_1.png') }}" border="0"></a> {% endif %} 
              {{ ligne }} </th>
          {% else %}
                <td> {{ ligne }} </td>
          {% endif %}
          {% set i = i + 1 %}
        {% endfor %}
     </tr>
     {% endfor %}
    </tbody>
</table>
        
        
 {% endblock %}